package com.xctech.yace.service;

import com.xctech.yace.enumeration.DimMapping;
import com.xctech.yace.factory.MybatisSessionFactory;
import com.xctech.yace.manger.DimDataManager;
import com.xctech.yace.pojo.Interest;
import com.xctech.yace.util.DateUtil;
import com.xctech.yace.util.InterestTax;
import org.apache.ibatis.session.SqlSession;

import java.util.HashMap;
import java.util.Properties;

public class InterestTaxService {
    public static void main(String[] args) {
        Properties props = new Properties();
        props.setProperty("driver", "oracle.jdbc.driver.OracleDriver");
        props.setProperty("url", "jdbc:oracle:thin:@192.168.0.63:1521:orcl");
        props.setProperty("username", "dc");
        props.setProperty("password", "dc");
        SqlSession sqlSession = MybatisSessionFactory.getSqlSessionFactory(props).openSession();
        DimDataManager.getInstance().loadData(sqlSession);

        //HashMap<String, Object> tableData = DimDataManager.getInstance().getTableData(DimMapping.PRO_STOCK_HOLDER.getTable());
        HashMap<String, Object> tableData = DimDataManager.getInstance().getTableData(DimMapping.PRO_SEAT.getTable());

        Object objectBond = DimDataManager.getInstance().getRecord(DimMapping.VAR_BOND_INFO.getTable(), "2000117001");

//        String secuId="1000010112";
//        Double deliDt = 20211220.0;
//        Interest eval = InterestTax.eval(22341490, secuId, true, DateUtil.duobleOfDate(deliDt));
        System.out.println(objectBond);
    }
}
